﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Pibby.Core.Tests.Stubs
{
	public static class EpisodeFactory
	{
		public static EpisodeCollection GenerateEpisodes(string baseName, int howMany, EpisodeAge age, EpisodeLifecycle stage)
		{
			var episodes = new EpisodeCollection();

			for (int i = 0; i < howMany; ++i)
			{
				Episode e = new Episode()
				{
					Feed = new Uri(string.Format("http://{0}.com/episode{1}", baseName, i + 1)),
					Name = string.Format("Podcast {0} Episode {1}", baseName, i + 1),
					FileSize = 1024 * (i + 1),
					Duration = string.Format("0:0{0}:00", i + 1),
					PodcastName = baseName,
					PublicationDate = DateTime.Today.AddDays(-i),
					Age = age,
					Stage = stage,
					Description = "This is an episode of our podcast"
				};

				episodes.Add(e);
			}

			return episodes;
		}
	}
}
